package com.wc.codeforces.贪心.Black_Cells;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/10/28 23:39
 * @description https://codeforces.com/contest/2026/problem/B
 */
public class Main {
    /**
     * 思路：看清题意, 是需要两个白格子才能涂黑, 那就说明是相邻的最大的最小就好
     * 偶数的话, 没办法利用额外的格子
     * 奇数的话,每一个格子都可以当做额外的格子用
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 2010;
    static long[] a = new long[N];
    static int n;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            n = sc.nextInt();
            for (int i = 1; i <= n; i++) a[i] = sc.nextLong();
            long res = 1;
            for (int i = 2; i <= n; i += 2) {
                res = Math.max(res, a[i] - a[i - 1]);
            }
            if ((n & 1) == 1) {
                // 枚举当做其他的
                for (int i = 1; i <= n; i += 2) {
                    long maxv = 1;
                    for (int j = 1; j <= n; j += 2) {
                        if (j == i) j++;
                        maxv = Math.max(maxv, a[j + 1] - a[j]);
                    }
                    res = Math.min(res, maxv);
                }
            }
            out.println(res);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
